﻿<phone:PhoneApplicationPage 
    x:Class="AuchanScan.Views.PromoOffresPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    DataContext="{Binding Path=PromoViewModel,Source={StaticResource ViewModelLocator}}"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Margin="0,0,0,-13">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="/images/Page_Background.png" />
        </Grid.Background>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="12,0,12,0">
            <ListBox ItemsSource="{Binding Offres}" HorizontalContentAlignment="Stretch">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="0,0,0,12">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="0.788*" />
                                <ColumnDefinition Width="0.212*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Image Source="{Binding Image1}" MaxHeight="90" />
                            <TextBlock Style="{StaticResource PhoneTextTitle3Style}" Text="{Binding Nom1}"
                             d:LayoutOverrides="Width, Height" Grid.Column="1" FontWeight="Bold" TextWrapping="Wrap" />
                            <StackPanel Grid.ColumnSpan="3" Grid.Row="1" d:LayoutOverrides="Width" Orientation="Horizontal"
                              Visibility="Collapsed">
                                <TextBlock Text="du" VerticalAlignment="Center" Margin="0,0,5,0" />
                                <TextBlock Text="{Binding StartDate}" VerticalAlignment="Center" Margin="0,0,5,0" />
                                <TextBlock Text="au" VerticalAlignment="Center" Margin="0,0,5,0" />
                                <TextBlock Text="{Binding EndDate, StringFormat=dd/MM/yy}" VerticalAlignment="Center" Margin="0,0,5,0" />
                            </StackPanel>
                            <StackPanel Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Right">
                                <TextBlock Text="{Binding StrikePrice}" HorizontalAlignment="Right" Margin="12,0" />
                                <TextBlock Text="{Binding Price}" Style="{StaticResource PhoneTextAccentStyle}" HorizontalAlignment="Right" />
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>
